package com.bfly.mall.advert.enums;

/**
 * 优惠卷状态
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/9/20 22:50
 */
public enum CouponStatus {
    NOT_START(1, "未开始"),
    ON_SHELF(2, "进行中"),
    OFF_SHELF(3, "已下架"),
    EXPIRED(4, "已过期");

    CouponStatus(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static CouponStatus getStatus(int id) {
        for (CouponStatus status : CouponStatus.values()) {
            if (status.getId() == id) {
                return status;
            }
        }
        return null;
    }

    private int id;

    private String name;

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
}
